package com.ai.module.user.controller;

import com.ai.module.chat.config.advice.exception.BusinessException;
import com.ai.module.order.service.WxOrderService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author: MrHe
 * @create: 2023-11-26 14:21
 * @description:
 **/
@RestController
@RequestMapping("test")
@Api(hidden = true)
public class MrHeTestController {

    @GetMapping
    public String test(){
        System.out.println("success");
        return "success";
    }
    @GetMapping("testError")
    public String testError(){
        System.out.println("testError");
        int a= 1/0;
        return "success";
    }


    @GetMapping("chatError")
    public String chatError(){
        System.out.println("chatError");
        throw new BusinessException("chatError");
    }
    @Autowired
    private WxOrderService wxOrderService;

    @GetMapping("post")
    public String post(String code){
        System.out.println(code);
//        wxOrderService.loadCookie(code);
        return code ;
    }
}
